import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router'
import Login from "../views/Login.vue";

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/home',
        component: () => import('../views/Home.vue'),
        children: [
            {
                path: 'welcome',
                component: () => import('../views/home/Welcome.vue')
            },
            {
                path: 'help',
                component: () => import('../views/home/Help.vue')
            },
            {
                path: 'export',
                component: () => import('../views/home/Export.vue')
            },
            {
                path: 'employee-query',
                component: () => import('../views/home/EmployeeQuery.vue')
            },
            {
                path: 'employee-save',
                component: () => import('../views/home/EmployeeSave.vue')
            },
            {
                path: 'employee-remove',
                component: () => import('../views/home/EmployeeRemove.vue')
            },
            {
                path: 'cuisine-query',
                component: () => import('../views/home/CuisineQuery.vue')
            },
            {
                path: 'cuisine-save',
                component: () => import('../views/home/CuisineSave.vue')
            },
            {
                path: 'cuisine-remove',
                component: () => import('../views/home/CuisineRemove.vue')
            },
            {
                path: 'vip-query',
                component: () => import('../views/home/VIPQuery.vue')
            },
            {
                path: 'vip-save',
                component: () => import('../views/home/VIPSave.vue')
            },
            {
                path: 'vip-remove',
                component: () => import('../views/home/VIPRemove.vue')
            },
            {
                path:'order-query',
                component: () => import('../views/home/OrderQuery.vue')
            },
            {
                path: 'order-save',
                component: () => import('../views/home/OrderSave.vue')
            },
            {
                path: 'order-remove',
                component: () => import('../views/home/OrderRemove.vue')
            },
            {
                path:'marketing-query',
                component: () => import('../views/home/MarketingQuery.vue')
            },
            {
                path: 'marketing-save',
                component: () => import('../views/home/MarketingSave.vue')
            },
            {
                path: 'marketing-remove',
                component: () => import('../views/home/MarketingRemove.vue')
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router
